//引入moogoose
var mongoose = require("mongoose")
// 连接数据库
mongoose.connect('mongodb://localhost/graduation_design',{
  useNewUrlParser: true,
  useUnifiedTopology: true,
});
//连接成功后回调
mongooes.connection.once("open", function () {
  console.log("连接成功");
});

mongooes.connection.once("close", function () {
  console.log("数据库连接断开");
});

module.exports = mongoose;
